home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / utils / zoom.zoo / zoomline.s < prev   
Text File  |  1991-04-07  |  3KB  |  141 lines

  1. *
  2. * Zoom 16 screen lines up by 8 times
  3. *
  4.         csect    program
  5.  
  6.         xdef    @zoomLine
  7. *
  8. * Zoom a 16x16 square of pixels by 8
  9. *
  10. * void
  11. * zoomLine(void *screen, void *zoomed, short lineBytes, short offset)
  12. *
  13. * screen    : (word) address of top line in screen to be zoomed
  14. * zoomed    : address of array uchar[128][16]
  15. * lineBytes : bytes per screen line (found from line A structure)
  16. * offset    : bit offset of required word in a screen longword
  17. *
  18. * Lattice requires that functions preserve d2-d7/a2-6
  19. *
  20. @zoomLine
  21.         movem.l    d2-d4/a2,-(sp)
  22.  
  23.         swap.w    d0
  24.         clr.w    d0
  25.         swap.w    d0
  26.  
  27.         move.l    #$fefefefe,d2
  28.  
  29.         move.w    #15,d3
  30. oneline:
  31.         move.l    (a0),d4                Get 32 pixels
  32.         rol.l    d1,d4                Rotate to get correct pixels in top word
  33.         swap.w    d4                    Pixels now in low word of d4
  34.         adda.l    d0,a0                Point to next screen line down
  35.         movea.l    a1,a2                Save in a2, preparing for copy
  36.  
  37. * a0 = next screen line
  38. * a1 = 0'th line of zoomed blocks
  39. * a2 = 0'th line of zoomed blocks
  40. * d0 = bytes per screen line
  41. * d1 = shift for screen pixels
  42. * d2 = bit mask to get the Mac-style zoomed blocks
  43. * d3 = line count
  44. * d4 = (word) pixels
  45.  
  46. * 16 rotates and scs's produce a zoomed line in (a2)
  47.  
  48.         rol.w    #1,d4
  49.         scs.b    (a1)+
  50.         rol.w    #1,d4
  51.         scs.b    (a1)+
  52.         rol.w    #1,d4
  53.         scs.b    (a1)+
  54.         rol.w    #1,d4
  55.         scs.b    (a1)+
  56.         rol.w    #1,d4
  57.         scs.b    (a1)+
  58.         rol.w    #1,d4
  59.         scs.b    (a1)+
  60.         rol.w    #1,d4
  61.         scs.b    (a1)+
  62.         rol.w    #1,d4
  63.         scs.b    (a1)+
  64.         rol.w    #1,d4
  65.         scs.b    (a1)+
  66.         rol.w    #1,d4
  67.         scs.b    (a1)+
  68.         rol.w    #1,d4
  69.         scs.b    (a1)+
  70.         rol.w    #1,d4
  71.         scs.b    (a1)+
  72.         rol.w    #1,d4
  73.         scs.b    (a1)+
  74.         rol.w    #1,d4
  75.         scs.b    (a1)+
  76.         rol.w    #1,d4
  77.         scs.b    (a1)+
  78.         rol.w    #1,d4
  79.         scs.b    (a1)+
  80.  
  81.         and.l    d2,(a2)+            Clear right-most bit in each byte
  82.         and.l    d2,(a2)+
  83.         and.l    d2,(a2)+
  84.         and.l    d2,(a2)
  85.  
  86.         lea        -12(a2),a2            Correct
  87.  
  88. * Copy line 0 to line 1
  89.         move.l    (a2)+,(a1)+
  90.         move.l    (a2)+,(a1)+
  91.         move.l    (a2)+,(a1)+
  92.         move.l    (a2)+,(a1)+            Line 1
  93. * Line 1 to line 2
  94.         move.l    (a2)+,(a1)+
  95.         move.l    (a2)+,(a1)+
  96.         move.l    (a2)+,(a1)+
  97.         move.l    (a2)+,(a1)+            Line 2
  98. * Line 2 to line 3
  99.         move.l    (a2)+,(a1)+
  100.         move.l    (a2)+,(a1)+
  101.         move.l    (a2)+,(a1)+
  102.         move.l    (a2)+,(a1)+            Line 3
  103. * Line 3 to line 4
  104.         move.l    (a2)+,(a1)+
  105.         move.l    (a2)+,(a1)+
  106.         move.l    (a2)+,(a1)+
  107.         move.l    (a2)+,(a1)+            Line 4
  108. * Line 4 to line 5
  109.         move.l    (a2)+,(a1)+
  110.         move.l    (a2)+,(a1)+
  111.         move.l    (a2)+,(a1)+
  112.         move.l    (a2)+,(a1)+            Line 5
  113. * Line 5 to line 6
  114.         move.l    (a2)+,(a1)+
  115.         move.l    (a2)+,(a1)+
  116.         move.l    (a2)+,(a1)+
  117.         move.l    (a2),(a1)+            Line 6
  118. * Clear line 7
  119.         clr.l    (a1)+
  120.         clr.l    (a1)+
  121.         clr.l    (a1)+
  122.         clr.l    (a1)+                Line 7
  123.  
  124. * a0 = address of next screen word to be zoomed
  125. * a1 = address of first long in next zoom line
  126. * a2 = address of last long in line 6
  127. * d0 = bytes per screen line
  128. * d2 = 0xfefefefe
  129. * d3 = line count
  130. * d4 = screen word
  131.  
  132.         dbra    d3,oneline
  133.  
  134.         movem.l    (sp)+,d2-d4/a2
  135.  
  136.         rts
  137.  
  138.         end
  139.  
  140. * End of zoomline.s
  141.